#ifndef QUEUE_H_
#define QUEUE_H_

#include <stdlib.h>

typedef struct queue 
{
	unsigned char *pBase;
	int front;    //指向队列第一个元素
	int rear;    //指向队列最后一个元素的下一个元素
	int maxsize; //循环队列的最大存储空间
}QUEUE,*PQUEUE;

void createQueue(PQUEUE Q,int maxsize, unsigned char *pBuf);
unsigned char isQueueFull(PQUEUE Q);
unsigned char isQueueEmpty(PQUEUE Q);
unsigned char enqueue(PQUEUE Q, unsigned char val);
unsigned char dequeue(PQUEUE Q, unsigned char *val);
void flushQueue(PQUEUE Q);
void deleteQueue(PQUEUE Q);
#endif

